package com.example.recycler.wheelviewc;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.wx.wheelview.adapter.ArrayWheelAdapter;
import com.wx.wheelview.widget.WheelView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        List<String> mStrings=new ArrayList<>();
        for(int i='A';i<='Z';i++){
            mStrings.add("数据"+i);
        }
        WheelView wheelView = (WheelView) findViewById(R.id.wheelview);
        wheelView.setWheelAdapter(new ArrayWheelAdapter(this)); // 文本数据源
        wheelView.setSkin(WheelView.Skin.Common); // common皮肤
        wheelView.setWheelData(mStrings);  // 数据集合
        wheelView.setWheelSize(5);
        wheelView.setWheelClickable(true);
    }
}
